<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>内容页</title>
		<link rel="stylesheet" type="text/css" href="__STATIC__/Home/css/content.css" />
		<link rel="stylesheet" type="text/css" href="__STATIC__/Home/css/base.css" />
		
		<include file="__VIEW__/Common/header.html" />
		<script src="__STATIC__/Home/js/base.js"></script>
		<script src="__STATIC__/Home/js/jquery.jqzoom.js"></script>
		<script type="text/javascript">
			$(function(){
				$('.dl_5 a').click(function(){
//					alert(1);
					$(this).addClass('redss').siblings().removeClass('redss');
					//选择的长度
					var len = $('.redss').length;
					//li 的长度，就是有几种规格
					var liLen = $('.dl_5').length;
					//选中2个以上才发送异步
					if(len>=liLen){
						var id = '';
						$.each($('.redss'),function(){
							id += $(this).attr('specId') + ',';
							$('input[name=price]').val(id);
						})
//						alert(id);
						var gid = {$shopData.gid};
//						alert(gid);
//						//下面发异步，查询数据库
						$.ajax({
							type:"post",
							url:"{|U:'Content/getAdd'}",
							data:{id:id,gid:gid},
							dataType:'json',
							success:function(phpData){
								if(phpData['inventory']){
									$('.p_2').html(phpData['specArr']);
									$('.dl_6 .dd').html('库存：'+phpData['inventory']+'件');
									$('input[name=specid]').val(phpData['specArr']);
								}else{
									$('.dl_6 .dd').html('库存：暂无库存');
								}
							}
						});
						
						
						
						
					}
						
			
				})
				//点击+-购买商品
				var num = 1;
				//商品数量
				$('.add').click(function(){
//					alert(1);
					num=num+1;
					$('#num').val(num);
				})
				$('.del').click(function(){
					if(num==1){
						return false;
					}
					num=num-1;
					$('#num').val(num);
				})

					//如果暂无库存，则不能提交
				$('form').submit(function(){
					//如果没有库存则不能提交
					if($('.kucun').html()=='库存：暂无库存'){
						return false;
					}
					//如果没有选择规格则不能提交
					var len = $('.redss').length;
					//li 的长度，就是有几种规格
					var liLen = $('.dl_5').length;
					//选中2个以上才能提交
					if(len<liLen){
						$('.messeg').html('请选择规格！');
						return false;
					}
					/*if(session["uid"]==null){
						hd_modal_test();
						return false;
					}*/
				})
				
			})
		</script>
		<!--内容开始-->
		<div id="content">
			<div class="content_left" >
				<center>
					<list from="$detail['shop_pic']" name="$v" row="1">
						<div id="preview" class="spec-preview "> <span class="jqzoom" ><img jqimg="__ROOT__/{$v.big}" src="__ROOT__/{$v.mid}" /></span> </div>
					</list>
					<!--缩图开始-->
					<div class="spec-scroll"> <a class="prev">&lt;</a> <a class="next">&gt;</a>
						<div class="items">
							<ul>
								<foreach from="$detail['shop_pic']" key="$k" value="$v">
									<li><img alt="" bimg="__ROOT__/{$v.big}" src="__ROOT__/{$v.mid}" onmousemove="preview(this);"></li>
								</foreach>
							</ul>
						</div>
					</div>
					<!--缩图结束-->
				</center>

			</div>
			<div class="content_middle">

				<p>{$shopData['gname']}</p>
				
				<div class="d_1">原价：<span>{$shopData['marketprice']}元</span></div>
				<div class="d_2">
					<span class="sp_1">现价：</span><span class="sp_2 p_2" style="font-family: '微软雅黑';">¥ {$shopData['shopprice']}</span> <span class="sp_3">7折</span>
				</div>
				<div class="d_3">
					<ul>
						<li class="li_1">
							<p class="xinxin">5分</p>
							<p>评价</p>
						</li>
						<li class="li_2">
							<p>758</p>
							<p>销量</p>
						</li>
						<li class="li_3">
							<p>92</p>
							<p>累计评价</p>
						</li>
					</ul>
				</div>
				<div class="d_4">
					<!--<dl class="dl_1">
				<dt>优惠：</dt>
				<dd class="bg">满件立减</dd>
				<dd>全店满2件减3元</dd>
			</dl>
			<br /><br />
			<dl class="dl_2">
				<dt>配送：</dt>
				<dd>广东省广州市发出</dd>
				<dd>全国包邮</dd>
			</dl>
			<br /><br />
			<dl class="dl_3">
				<dt>客服：</dt>
				<dd></dd>
			</dl>-->
					<!--<br /><br /><br />-->
					<foreach from="$tempSpec" key="$k" value="$v">
						<dl class="dl_5">
							<dt>{$v.name}：</dt>
							<dd>
								<foreach from="$v['value']" key="$kk" value="$vv">
									<a href="javascript:;" specId="{$vv.gtid}">{$vv.gtvalue}</a>
								</foreach>
								<!--<a href="javascript:;" specId="111">紫色</a>-->
							</dd>
						</dl>
						<br />
						<br />
						<br />
				</foreach>
				<!--***************-->
				<!--提交购物车需要的4种数据，用隐藏域传过去-->
				<form id="form" action="{|U:'Cart/index'}" method="post">
					<dl class="dl_6">
						<dt>数量：</dt>
						<dd><a href="javascript:;"><span class="sp_1 del"></a></span><input type="" name="num" id="num" value="1" style="border: 1px solid #DDDDDD;float: left;width: 50px;height: 25px;text-align: center;"/><a href="javascript:;"><span class="sp_2 add"></span></a></dd>
						<dd class="dd kucun">库存：10000件</dd>
					</dl>
				</div>
				<span class="messeg" style="margin-left: 170px;font-size: 15px;"></span>
				<div class="d_5">
					<a href="{|U:'Order/index'}" class="a_left"></a>
						
						<input type="hidden" name="gid" value="{$shopData['gid']}"/>
						<input type="hidden" name="gname" value="{$shopData['gname']}"/>
						<input type="hidden" name="specid" value=""/>
						<input type="hidden" name="price" value=""/>
						<input type="submit" name="" id="" value="加入购物车" class="a_right"/>
						
					</form>
					
					<!--给购物车加一个点击事件，判断用户是否登陆-->
					<script type="text/javascript">
						$(function(){
							$('#form').submit(function(){
								var x=<?php if(isset($_SESSION['uid'])){echo "1";}else{echo 0;} ?>;
								if(!x){
									window.location.href="{|U:'Login/index'}"
									return false;
								}
							})
						})
					</script>
					<!--*******************-->
					<a href="" ></a>
				</div>
				<div class="d_6">
					<div class="div_1"><b></b><a href="">1286</a></div>
					<div class="div_2"><b></b><a href="">分享</a></div>
					<div class="div_3"><a href="">举报</a></div>
				</div>
				<div class="d_7"></div>
				<div class="d_8">

				</div>
			</div>
			<div class="content_right">
				<p><span>正在热卖</span></p>
				<div>
					<ul>
						<li>
							<a href=""><img src="__STATIC__/Home/images/contright_1.jpg" alt="" /></a>
						</li>
						<li>
							<a href=""><img src="__STATIC__/Home/images/contright_2.jpg" alt="" /></a>
						</li>
						<li>
							<a href=""><img src="__STATIC__/Home/images/contright_3.jpg" alt="" /></a>
						</li>
						<!--<li><a href=""><img src="__STATIC__/Home/images/contright_4.jpg" alt="" /></a></li>-->
					</ul>
				</div>
			</div>
		</div>

		<!--内容结束-->
		<!--商品详情开始-->
		<div id="for_det">
			<ul>
				<li><a href="" class="la_first">商品详情</a></li>
				<li><a href="">买家评价(5457)</a></li>
				<li><a href="">90天销量(32537)</a></li>
			</ul>
		</div>

		<!--店主推荐-->
		<div id="boss">
			<div class="b_top">店主推荐 ARRIVALS</div>
			<div class="b_bottom">
				<ul>
					<li>
						<a href=""><img src="__STATIC__/Home/images/mei0.jpg" alt="" /></a>
						<p><a href="">欧美时尚显瘦针织背心裙</a></p>
						<p>
							<span class="rmb"><u></u>36.40</span>
							<span class="like">1688</span>
						</p>
					</li>
					<li>
						<a href=""><img src="__STATIC__/Home/images/mei0.jpg" alt="" /></a>
						<p><a href="">欧美时尚显瘦针织背心裙</a></p>
						<p>
							<span class="rmb"><u></u>36.40</span>
							<span class="like">1688</span>
						</p>
					</li>
					<li>
						<a href=""><img src="__STATIC__/Home/images/mei0.jpg" alt="" /></a>
						<p><a href="">欧美时尚显瘦针织背心裙</a></p>
						<p>
							<span class="rmb"><u></u>59.00</span>
							<span class="like">1688</span>
						</p>
					</li>
					<li>
						<a href=""><img src="__STATIC__/Home/images/mei0.jpg" alt="" /></a>
						<p><a href="">欧美时尚显瘦针织背心裙</a></p>
						<p>
							<span class="rmb"><u></u>36.40</span>
							<span class="like">1688</span>
						</p>
					</li>
					<li>
						<a href=""><img src="__STATIC__/Home/images/mei0.jpg" alt="" /></a>
						<p><a href="">欧美时尚显瘦针织背心裙</a></p>
						<p>
							<span class="rmb"><u></u>36.40</span>
							<span class="like">1688</span>
						</p>
					</li>
				</ul>
			</div>
		</div>

		<!--店主推荐结束-->

		<!--图片-->
		<div id="tu">
			<a href=""><img src="__STATIC__/Home/images/tu9.jpg" alt="" /></a>
		</div>

		<include file="__VIEW__/Common/bottom.html" />